package com.sanchunhui.psc.presenter

import com.sanchunhui.psc.data.protocol.ResponseInfo
import com.sanchunhui.psc.ext.excute
import com.sanchunhui.psc.presenter.view.AddTeamView
import com.sanchunhui.psc.presenter.view.SetTeamInfoView
import com.sanchunhui.psc.rx.BaseSubscriber
import com.sanchunhui.psc.service.ProjectTeamService
import javax.inject.Inject

/**
 * @Author zyx
 * @Date 2021/7/23-9:02
 * @Dscribe
 */
class SetTeamInfoPresenter@Inject constructor() : BasePresenter<SetTeamInfoView>() {

    @Inject
    lateinit var teamService: ProjectTeamService

    /*
        设置指定分组名称
     */

    fun setTeamInfo(teamId: Int, token: String, name: String) {
        if (!checkNetWork()) {
            return
        }
        mView.showLoading()
        teamService.setTeamInfo(teamId,token,name).excute(object:BaseSubscriber<Boolean>(mView) {
            override fun onNext(t: Boolean) {
                mView.onSetTeamInfoResult(t)
            }
        },lifecycleProvider)
    }
}